package com.heima.article.controller;

import com.heima.article.service.ApArticleService;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.common.dtos.ResponseResult;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @program: heima-leadnews
 * @description:
 * @author: ryp
 * @create: 2023-04-29 12:13
 **/
@RestController
public class ArticleController {
    @Autowired
    private ApArticleService apArticleService;

    /**
     * 功能描述: 保存app端相关文章
     * @param dto
     * @return : com.heima.model.common.dtos.ResponseResult
     */
    @PostMapping("/api/v1/article/save")
    public ResponseResult saveArticle(@RequestBody ArticleDto dto) throws IOException {
        return apArticleService.saveArticle(dto);
    }
}
